package com.aaa.controller.api;

import com.aaa.aop.annotation.Log;
import com.aaa.entity.CheckItem;
import com.aaa.entity.RegisteredItem;
import com.aaa.service.RegisteredItemService;
import com.aaa.vo.RegisteredItemVo;
import com.aaa.vo.Result;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Arrays;

/**
 * @BelongsPackage: com.aaa.controller.api
 * @Description:
 * @CreateTime: 2023-03-30  19:50
 * @Author: ql
 */
@RestController
@RequestMapping("/system/api/RegisteredItem")
public class ApiRegisteredItemController {

    @Autowired
    private RegisteredItemService service;

    @PostMapping("/queryByPage")
    public Result<IPage<RegisteredItem>> queryByPage(@RequestBody RegisteredItemVo vo){
        return service.queryByPage(vo);
    }
    @GetMapping("/queryById/{id}")
    public Result<RegisteredItem> queryById(@PathVariable Long id){
        return service.queryById(id);
    }
    @PostMapping("/addOrUpdRegisteredItem")
    public Result<String> addOrUpdRegisteredItem(@RequestBody RegisteredItem registeredItem){
        return service.addOrUpdRegisteredItem(registeredItem);
    }

    @DeleteMapping("/deleteByIds/{id}")
    @Log(title = "批量删除",business_type = "1")
    public Result<String> deleteByIds(@PathVariable Long[] id){
        System.out.println("=========== " + Arrays.toString(id));
        return service.deleteByIds(id);
    }



}
